package com.jl.jlapp.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jl.jlapp.R;
import com.jl.jlapp.eneity.GoodsDetailModel;

import java.util.List;

public class GoodsMsgActivityAdapter
        extends BaseQuickAdapter<GoodsDetailModel.ResultDataBean.GoodsActivitysBean, BaseViewHolder> {
    public GoodsMsgActivityAdapter(int paramInt, @Nullable List<GoodsDetailModel.ResultDataBean.GoodsActivitysBean> paramList) {
        super(paramInt, paramList);
    }

    protected void convert(BaseViewHolder paramBaseViewHolder, GoodsDetailModel.ResultDataBean.GoodsActivitysBean paramGoodsActivitysBean) {
        TextView localTextView = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_activity_type);
        localTextView.setVisibility(View.VISIBLE);
        if (paramGoodsActivitysBean.getActivityInformation().getNameX().equals("暂无优惠")) {
            localTextView.setVisibility(View.GONE);
            paramBaseViewHolder.setText(R.id.goods_activity_content, "暂无优惠");
            return;
        }
        switch (paramGoodsActivitysBean.getActivityInformation().getActivityType()) {

            case 0:
                paramBaseViewHolder.setText(R.id.shop_cart_activity_type, "折扣");
                paramBaseViewHolder.setText(R.id.goods_activity_content, "打 " + paramGoodsActivitysBean.getActivityInformation().getDiscount() * 10.0D + " 折，最多可购买" + paramGoodsActivitysBean.getActivityInformation().getMaxNum() + "个");
                return;
            case 1:
                paramBaseViewHolder.setText(R.id.shop_cart_activity_type, "团购");
                paramBaseViewHolder.setText(R.id.goods_activity_content, "团购单价为¥" + paramGoodsActivitysBean.getActivityInformation().getDiscount() + "，最多可购买" + paramGoodsActivitysBean.getActivityInformation().getMaxNum() + "个");
                return;
            case 2:
                paramBaseViewHolder.setText(R.id.shop_cart_activity_type, "秒杀");
                paramBaseViewHolder.setText(R.id.goods_activity_content, "秒杀单价为¥" + paramGoodsActivitysBean.getActivityInformation().getDiscount() + "，最多可购买" + paramGoodsActivitysBean.getActivityInformation().getMaxNum() + "个");
                return;
            case 3:
                paramBaseViewHolder.setText(R.id.shop_cart_activity_type, "立减");
                paramBaseViewHolder.setText(R.id.goods_activity_content, "购买可立减¥" + paramGoodsActivitysBean.getActivityInformation().getDiscount() + "，最多可购买" + paramGoodsActivitysBean.getActivityInformation().getMaxNum() + "个");
                return;
            default:
                paramBaseViewHolder.setText(R.id.shop_cart_activity_type, "满减");
                paramBaseViewHolder.setText(R.id.goods_activity_content, "该商品满¥" + paramGoodsActivitysBean.getActivityInformation().getPrice() + "，可减¥" + paramGoodsActivitysBean.getActivityInformation().getDiscount());

                return;
        }
    }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/adapter/GoodsMsgActivityAdapter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */